import React, {Component} from 'react';
import {
    Text,
    View,
    TouchableOpacity,
    Image,
} from 'react-native';
import Ionicons from 'react-native-vector-icons/Ionicons';

export default HeaderBar = ({titleView,rightButton,leftClick})=>{
    return <View
        style={{
            paddingHorizontal:15,
            paddingTop:5,
            flexDirection:'row',
            alignItems:'center'
        }}>
        <View style={{flex:1}}>
            <TouchableOpacity
                onPress={leftClick}
                style={{
                    paddingRight: 15,
                    flexDirection: 'row',
                    alignItems: 'center'
                }}>
                <Ionicons name="ios-arrow-back-outline" size={26} color="#fff"/>
                <Text style={{color: '#fff', paddingLeft: 5,fontSize:16}}>返回</Text>
            </TouchableOpacity>
        </View>
        <View style={{flex:2,backgroundColor:'blue'}}>
            {titleView&&titleView()}
        </View>
        <View style={{flex:1,alignItems:'flex-end'}}>
            {rightButton&&rightButton()}
        </View>
    </View>
}